package com.jintoufs.service.customer;

import com.jintoufs.dao.QueryFilters;
import com.jintoufs.domain.customer.Customer;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/9/1 0001.
 */
public interface CustomerService {

    /**
     * 根据条件查询
     *
     * @param filters 属性列表，过滤存在的属性值
     */
    List<Customer> getByFilter(QueryFilters filters);
    /**
     * 根据条件查询
     *
     * @param filters 属性列表，过滤存在的属性值
     */
    List<Map<String,Object>> getByFilter2(QueryFilters filters);

    /**
     * 根据参数查询
     */
    List<Customer> queryByParams(Map<String, Object> params);

    /**
     * 添加
     */
    Customer add(Customer customer);

    /**
     * 添加
     * @param customer
     * @return
     */
    Customer addCustomer(Customer customer);

    /**
     * 更新
     */
    void update(Customer customer);

    /**
     * 删除
     */
    void delete(String id);

    Customer getById(String id);

    Customer initPassword(String id);

    Customer getByToken(String token);

    Map<String,Object> queryUserById(String id);

    Boolean auth(Map<String,Object> param);

    List<Customer> getUserByRoleName(String roleName);

    /**
     * 计算分润金
     * @param customerId 购买者Id
     * @param price 直客價价格
     * @param orderPrice 實際支付价格
     * @param costPrice 订单分销价
     * @param customer 供应商
     * @param spreadId 推广人
     */
    public void computDilivid(String orderId,String customerId,BigDecimal price,  BigDecimal orderPrice, BigDecimal costPrice,Customer customer,String needBill,String spreadId);


    public void sendSms(String mobile, ArrayList<String> params , int smsId);

    List queryOrderByParams(Map params);

}
